<template>
    <require from="./em-project-modal.less"></require>
    <em-modal classes="em-project-modal" em-modal.ref="emModal" onshow.call="showHandler($event)" onapprove.call="approveHandler($event)">
        <div slot="header">项目管理</div>
        <div slot="content">
            <div>
                <div class="ui blue button" click.delegate="createHandler()">
                    <i class="plus icon"></i> 创建项目
                </div>
            </div>
            <table class="ui selectable striped single line table">
                <thead>
                    <tr>
                        <th>名称</th>
                        <th>标识</th>
                        <th>网址</th>
                        <th>项目负责人</th>
                        <th>默认经办人</th>
                        <th class="right aligned">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr repeat.for="item of projects">
                        <td>${item.name}</td>
                        <td>${item.key}</td>
                        <td>${item.website}</td>
                        <td>${item.leader.name}</td>
                        <td>${item.operator.name}</td>
                        <td class="right aligned">
                            <div class="ui horizontal bulleted list">
                                <a class="btn item" click.delegate="editHandler(item)">编辑</a>
                                <a class="btn-delete item">删除</a>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </em-modal>
    <em-project-create view-model.ref="projectCreateVm"></em-project-create>
    <em-project-edit view-model.ref="projectEditVm"></em-project-edit>
</template>
